#ifndef BAG_DEALER_PROJECTOR_H
#define BAG_DEALER_PROJECTOR_H
#include <fstream>
#include <opencv2/opencv.hpp>
#include <ros/ros.h>
#include <ros/package.h>
#include <cv_bridge/cv_bridge.h>
#include <boost/filesystem.hpp>
#include <image_transport/image_transport.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/PointCloud2.h>
#include <message_filters/synchronizer.h>
#include <message_filters/subscriber.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl_ros/transforms.h>


namespace PercepViz
{
    class Projector
    {
    public:
        Projector(std::string image_topic, std::string pc_topic, std::string cfg, std::string video);
        ~Projector();
    private:
        cv::Mat image_proj;
        image_transport::Publisher image_pub;
        float maxX = 100.0;
        float maxY = 50.0;
        float minZ = -2;
        struct initial_parameters
        {
            cv::Mat cameraIn;
            cv::Mat RT;
        }i_params;
        cv::VideoWriter vWriter;
        void callback(const sensor_msgs::ImageConstPtr& img,
                      const sensor_msgs::PointCloud2ConstPtr& pc);
        void init(std::string cfg, std::string video);
    };
}

#endif //BAG_DEALER_PROJECTOR_H
